package com.zengqingfa.sharding.jdbc.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zengqingfa.sharding.jdbc.demo.entity.Log;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

/**
 *
 * @fileName: LogMapper
 * @author: zengqf3
 * @date: 2021-3-30 20:45
 * @description:
 */
public interface LogMapper extends BaseMapper<Log> {


    /**
     * 范围查询
     * @param startTime 开始时间
     * @param endTime 结束时间
     * @return
     */
    @Select("select * from log where create_time between #{startTime} and #{endTime}")
    List<Log> betweenAnd(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);


}
